package Session;
import java.util.HashMap;
/**
 * Created by:
 * User: Igor Martynovich and Guzenko Igor
 * Date: 21.11.13
 */
public class UserAnswers {
   private HashMap<Integer,String> userAnswers;

   public UserAnswers(int questionsCount){
       userAnswers = new HashMap<>(questionsCount);
   }

    public void setAnswer(int key,String answer){
       if(key<userAnswers.size()){
           userAnswers.put(key,answer);
       }
    }

    public String getAnswer(int key){
        String answer ="";
        if(key<userAnswers.size()){

           answer = userAnswers.get(key);
        }
        return answer;
    }

    public void clearAnswers(){
        userAnswers.clear();
    }

    public boolean isAnsweredAll(){
     return userAnswers.size()==userAnswers.values().size();
    }
}
